#'
#' remove individuals of given species from the community
#' 
#' 
#' @param com a community object
#' @param splist a vector of species names for deleting
#'
#' @examples
#' set.seed(1)
#' 
#' splist=paste("sp",1:3,sep="")
#' spab=c(30,50,10)
#' com=rcommunity(splist,spab)
#' com
#' remove_species(com,c("sp1","sp3"))
#'
#' remove_species(com,c())
#'
#'
#'@export
remove_species=function(com,splist){
  if(length(splist)==0) return(com)
  
  deli=numeric()
  for(i in 1:length(splist)){
    deli=c(deli,which(com$species==splist[i]))
  }
  com=remove_individuals(com,deli)
  com$species=as.factor(as.character(com$species))
  return(com)
}